<extend name="Common:base" />
<block name="head"></block>
<block name="body">
	<div id="app" class="container">
		<div class="wrapp" v-show="show" style="display: none">
			<!-- seach form -->
			<el-row>
				<el-col :span="12">
					<el-form :inline="true"  ref="searchForm" :model="searchForm">
					  <el-form-item prop="name" >
					    <el-input   placeholder="查询字段一"  v-model="searchForm.name"></el-input>
					    </el-form-item><el-form-item>
					    <el-select clearable placeholder="查询字段二">
					      <el-option label="区域一" value="区域一"></el-option>
					      <el-option label="区域二" value="区域二"></el-option>
					    </el-select>
					  </el-form-item>
					  <el-form-item>
					   <el-button icon="close" @click="searchReset">清空</el-button>
					    <el-button type="primary" icon="search" @click="loadDatalist" >查询</el-button> 
			        	<el-button  @click="openDialog('advancedSearch')" icon="search">高级查询</el-button>
					  </el-form-item>
					</el-form>
				</el-col>
				<el-col :span="12">
				<div class="pull-right">
					删除之后  <el-button @click="dataReload">刷新</el-button> 一下
				</div>
					
				</el-col>	
			</el-row>
			<!-- / search form -->

			<!-- datatables  -->
			<el-row>
				<el-col :span="24">
					<el-table  :data="dataList" border stripe height  v-loading.body="dataLoad" element-loading-text="拼命加载中" >
					    <el-table-column type="selection"  width="50" >
					    </el-table-column>
					    <el-table-column label="序号"  width="70" :formatter="handleIndex"  >
					    </el-table-column>
					    <el-table-column label="单位ID" prop="id" width="140" >
					    </el-table-column>
					    <el-table-column label="单位名" prop="name">
					    </el-table-column>
					    <!-- <el-table-column label="类型" >
					    </el-table-column>
						<el-table-column label="上级组织" >
					    </el-table-column>
					    <el-table-column label="片区" >
					    </el-table-column>
					    <el-table-column label="联系人" >
					    </el-table-column>
					    <el-table-column label="固定电话" >
					    </el-table-column>
					    <el-table-column label="拓展一" >
					    </el-table-column>
					    <el-table-column  label="拓展二" >
					    </el-table-column>
					    <el-table-column  label="形象照片" >
					    </el-table-column> -->

					    <el-table-column inline-template :context="_self"  fixed="right"  label="操作" width="150">
					      <span>
					        <el-button @click="handleEdit($index, row)"    size="small">编辑</el-button>
					        <el-button @click="handleDelete($index, row)"  size="small" type="danger">删除</el-button>
					      </span>
					    </el-table-column>
				    </el-table>
				</el-col>
			</el-row>
			<!-- / datatables  -->


			<!-- toolbar -->
			<el-row type="type"  justify="space-between" align="middle"  class="row-bg">
			  <el-col :span="12">
			  <div class="grid-content bg-purple">
			  	<span class="wrapper">
			  		<el-tooltip content="添加新的组织单位！" placement="right">
					    <el-button size="small" @click="openDialog('add')"   icon="plus" type="primary">添加</el-button>
					    <!-- <el-button  @click="">录入客户</el-button>
					    <el-button  @click="">修改客户</el-button> -->
					    <!-- <el-button>计划</el-button>
					    <el-button>推介</el-button> -->
				    </el-tooltip>
				</span>
			  </div>
			  </el-col>
			  <el-col :span="12">
				  <div class="grid-content bg-purple-light pull-right">
				    <!-- page -->
				    <include file="Common:_pagination" />
				    <!-- / page -->
				  </div>
			  </el-col>
			</el-row>
			<!-- / toolbar -->

		</div>

		<div v-show="show" style="display: none">
			<!-- 高级查询 -->
			<include file="_search" />
			<!-- / 高级查询 -->

			<!-- 添加 
			-->
			<include file="_add" />
			<!-- / 添加 -->

			<!-- 编辑 -->
			<include file="_edit" />
			<!-- / 编辑 -->
		</div>

		




		<div>
			<!-- tabs -->
			<el-tabs type="card" closable @tab-click="handleClick" @tab-remove="handleRemove">
			    <el-tab-pane label="用户管理">用户管理</el-tab-pane>
			    <el-tab-pane label="配置管理">配置管理</el-tab-pane>
			    <el-tab-pane label="角色管理">角色管理</el-tab-pane>
			    <el-tab-pane label="定时任务补偿">定时任务补偿</el-tab-pane>
			  </el-tabs>

			<!--  -->
		</div>


	</div>
</block>
<block name="scripts">
<script>
	window.defaultOption.setDatas({
		searchForm:{
			p   : 0,
			name: "",
		}
	}).setAdvancedSearch()
	// 默认提供了 add 与 edit两个表单
	.setForm('add', {
		name:""
	}).setForm('edit', {
		name:"",
		id:""
	}).setMethod('handleClick', function(tab, event){

	}).setMethod('handleRemove', function(tab){
		
	});
</script>
</block>